<?php
/**
 * simple class to hold all of the configuration settings for a project.
 *
 * @package System
 * @subpackage System_Configuration
 * @author Mark Henderson
 */
class System_Configuration_Root{
    /**
     * holds an instance of the class
     * 
     * @param System_Request_Url -- defaults to false
     * @static
     * @access private
     */
    private static $_instance = false;
    
    /**
     * array used to hold all of the settings
     * 
     * @var array
     * @static
     * @access private
     */
    private static $_settings = array();
    
    /**
     * class constructor made private to allow for singleton
     * 
     * @access public
     * @return void
     */
    private function __construct(){}
    
    /**
     * returns an instance of System_Configuration_Root
     *
     * @access public
     * @static
     * @return System_Configuration_Root
     */
    public static function getInstance(){
        if(!self::_instance){
            self::_instance = new self();
        }
        
        return self::_instance;
    }
    
    /**
     * method used to set a {@link _settings} property
     *
     * @access public
     * @static
     * @return void
     */
    public static function set(){
        
    }
    
    /**
     * method used to return a specific setting
     * 
     * @param mixed -- pass in the settings that you are looking for in the order in which they would appear in the {@link _settings} property. ie get('database','default','username');
     * @access public
     * @static
     * @return boolean|array|string|integer
     */
    public static function get(){
        $return  = false;
        $indexes = implode('][', func_get_args());
        
        if(isset(self::$_settings[$indexes])){
            $return = self::$_settings[$indexes];
        }
        
        return $return;
    }
}